<div class="am-u-sm-12 widget main-w" >
    <div class="am-u-sm-12 cl-p" style="max-width: 100%;overflow: auto;">
        <form class="am-form-inline tpl-form-border-form" method="get" action="">
            <div class="am-form-group am-u-sm-2 ">
                <div class="am-u-sm-12 cl-p">
                </div>
            </div>
            {if $order_types}
            {else/}
            {/if}
            {if input('param.op')}
            {else/}
            {/if}
            <div class="am-form-group am-u-sm-3">
                <div class="am-u-sm-3 cl-p">
                </div>
                <div class="am-u-sm-9 cl-p">
                    <div class="am-u-sm-6 cl-p">
                        <!--<input type="hidden" name="passenger_name" class="tpl-form-no-bg orderer" placeholder="请输入名称">-->
                    </div>
                    <div class="am-u-sm-6 cl-p">
                    </div>
                </div>
            </div>

            <div class="am-form-group am-u-sm-3">
            </div>
            <div id="showmore" style="display: none;">
                <div class="am-u-sm-12" style="padding:5px 0;">
                    <div class="am-u-sm-3">
                        <div class="am-u-sm-12 cl-p">
                            <div class="am-u-sm-6 cl-p">
                                <div class="am-u-sm-11 cl-p">

                                </div>
                                <div class="am-u-sm-1 cl-p" style="text-align: center;">-</div>
                            </div>
                            <div class="am-u-sm-6 cl-p">
                                <div class="am-u-sm-12 cl-p">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="am-u-sm-2 cl-p">
                        <div class="am-u-sm-12 ">
                        </div>
                    </div>
                    <div class="am-u-sm-6 cl-p">&nbsp;</div>
                </div>
            </div>
        </form>
    </div>
    <div class="am-u-sm-12" style="padding:10px 0 0 10px;">

        <div class="am-tabs">
            <div class="amnav">
            </div>
            <div class="am-tabs-bd" style="width: 100%;">
                <div class="am-u-sm-12 cl-p">
                    <div>
                        <div style="padding: 10px;" class="am-u-sm-12 am-scrollable-horizontal">
                            <!--<div><button style="float: right;" type="button" class="am-btn am-btn-default am-radius am-btn-xs" style="margin-top: -2px;">导出文件</button></div>-->
                            <table width="100%" class="am-table am-table-compact am-table-bordered am-table-radius am-table-striped tpl-table-black am-text-nowrap">
                                <thead>
                                <tr>
                                    <th>订单号</th>
                                    <th>计划出发时间</th>
                                    <th>结束时间</th>
                                    <!--<th>批准时间</th>-->
                                    <!--<th>接单时间</th>-->
                                    <th>支付类型</th>
                                    <th>下单车型</th>
                                    <th>已派车型</th>
                                    <!--<th>订单类型</th>-->
                                    <th>订单类别</th>
                                    <th>乘客</th>
                                    <th>司机</th>
                                    <th>出发地</th>
                                    <th>目的地</th>
                                    <th>状态</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                {foreach $list as $key => $item}
                                {switch name="item.order_state"}
                                {case value="2" break="1"}
                                <tr data-id='{$item.order_id}' style="color: #ff9800;">
                                    {/case}
                                    {case value="3" break="1"}
                                <tr data-id='{$item.order_id}' style="color: #ddd;">
                                    {/case}
                                    {case value="4" break="1"}
                                <tr data-id='{$item.order_id}' style="color: red;">
                                    {/case}
                                    {case value="5" break="0"}{/case}
                                    {case value="6" break="0"}{/case}
                                    {case value="7" break="0"}{/case}
                                    {case value="8" break="0"}{/case}
                                    {case value="9" break="1"}
                                <tr data-id='{$item.order_id}' style="color: green;">
                                    {/case}
                                    {case value="12" break="1"}
                                <tr data-id='{$item.order_id}' style="color: #ddd;">
                                    {/case}
                                    {default /}
                                <tr data-id='{$item.order_id}' style="color: #555;">
                                    {/switch}
                                    <td>
                                        <a href="{:url('detail',['order_id'=>$item.order_id])}">{$item.order_no?:'无订单'}</a>
                                    </td>
                                    <td>{$item.plan_time?:'-'}</td>
                                    <td>{$item.arrival_time?:"-"}</td>
                                    <!--<td>{$item.approval_time?:"-"}</td>-->
                                    <!--<td>{$item.orders_time?:"-"}</td>-->
                                    <td>
                                        {if $item.pay_type==1} 个人 {elseif $item.pay_type==2/} 单位支付 {elseif $item.pay_type==3/} 财政支付 {elseif $item.pay_type==4/} 自有用车{/if}
                                    </td>
                                    <td>{$item.o_car_type_name}</td>
                                    <td>{$item.car_type_name}</td>
                                    <td style="<?=($item['use_type'] == 1 ? 'color: #4caf50;' : '');?>">
                                        {if $item.booking_type==1} 订车 {elseif $item.booking_type==2/} 包车 {elseif $item.booking_type==3/} 租赁 {/if}-
                                        {if $item.pay_type==3} 公务 {elseif $item.pay_type==2/} 单位 {elseif $item.pay_type==1/} 个人 {/if}-
                                        {if $item.use_type==1} 行政执法 {elseif $item.use_type==2/} 特殊公务 {elseif $item.use_type==3/} 重要会议 {elseif $item.use_type==4/} 机要通讯 {elseif $item.use_type==5/} 视察调研 {else/} 公务接待 {/if}
                                    </td>
                                    <!--<td>{$item.order_type}</td>-->
                                    <td><a href="{:url('/admin/passenger/detail',['passenger_id'=>$item.passenger_id])}">{$item.passenger_name}</a>（{$item.company_name}）</td>
                                    <td><a href="{:url('/admin/driver/detail',['driver_id'=>$item.driver_id])}">{$item.driver_name}</a></td>
                                    <td class="td-address-max">{$item.from_addr?:'暂无出发地'}</td>
                                    <td class="td-address-max">{$item.to_addr?:'暂无出发地'}</td>
                                    <td>
                                        {if $item.order_state==1} 待审批 {elseif $item.order_state==2/} 已批准 {elseif $item.order_state==3/} 已拒绝 {elseif $item.order_state==4/} 待用车 {elseif $item.order_state==5/} 已派车 {elseif $item.order_state==6/} 接驾中 {elseif $item.order_state==7/} {if $item.go_time}任务中{else/}已到达出发地 {/if}{elseif $item.order_state==8/} 已到达目的地 {elseif $item.order_state==9/} 待支付 {elseif $item.order_state==10/} 待评价 {elseif $item.order_state==11/} 已完成 {elseif $item.order_state==12/} 已取消 {elseif $item.order_state==13/} 已终止 {else/} 无效 {/if}
                                    </td>
                                    <td>
                                        <div class="tpl-table-black-operation">
                                            {if $item.order_state==1}

                                            {if $item.order_state>=8}{else/}
                                            <a href="javascript:;" class="tpl-table-black-operation-del cancel" data-method="cancel">
                                                <i class="am-icon-pencil"></i> 取消
                                            </a>
                                            {/if}
                                            {elseif $item.order_state==3/}
                                            <a href="javascript:;" class="tpl-table-black-operation-del cancel" data-method="cancel">
                                                <i class="am-icon-pencil"></i> 取消
                                            </a>
                                            {elseif $item.order_state==2||$item.order_state==4/}
                                            <a href="{:url('dispatch',['order_id'=>$item.order_id])}">
                                                <i class="am-icon-pencil"></i> 派车
                                            </a>
                                            <a href="javascript:;" class="tpl-table-black-operation-del cancel" data-method="cancel">
                                                <i class="am-icon-pencil"></i> 取消
                                            </a>
                                            {else/}
                                            {if $item.order_state>=8}
                                            {if $item.order_state==12}
                                            已取消
                                            {else/}
                                            <a class="showmap" data-method="showmap" href="javascript:;">
                                                <i class="am-icon-map"></i> 轨迹
                                            </a>
                                            {/if}
                                            {/if}
                                            {if $item.order_state>8}{else/}

                                            <a href="javascript:;" class="tpl-table-black-operation-del cancel" data-method="cancel">
                                                <i class="am-icon-pencil"></i> 取消
                                            </a>
                                            {/if}
                                            {/if}
                                        </div>
                                    </td>
                                </tr>
                                {/foreach}
                                </tbody>
                            </table>
                        </div>
                        <div class="am-u-lg-12 am-cf">
                            <div class="am-fr">
                                {$pager}
                            </div>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>

</div>
<script>
    var url = '{url("api/driver.test/index)}';
</script>
<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.2&key={:config('base.mapkey')}&plugin=AMap.Driving"></script>
<script src="//webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script>